<template>
	<view class="app-container">
		<view class="app-content">
			<commodity-list :categoryId="categoryId" ref="productList"></commodity-list>
		</view>
	</view>
</template>

<script>
	import CommodityList from '@/components/common/CommodityList.vue'
	export default {
		components: {
			CommodityList
		},
		data() {
			return {
				categoryId: ''
			}
		},
		onReachBottom() {
			let productComponentList = this.$refs.productList
			productComponentList.queryParams.pageNo += 1
			productComponentList.listData()
		},
		onLoad(e) {
			if(e) {
				let data = JSON.parse(e.category)
				uni.setNavigationBarTitle({
					title: data.name
				})
				this.categoryId = data.id
			}
		},
		methods: {

		}
	}
</script>

<style scoped>
	.app-container {
		background-color: #F0F1F5;
		position: absolute;
		bottom: 0;
		top: 0;
		left: 0;
		right: 0;
	}
</style>